<?php
/**
 * Created by PhpStorm.
 * User: zhangrongxiang
 * Date: 2017/5/23
 * Time: 下午5:56
 */

for ($i = 0; $i < 10; $i++) {
    print_r(test());
}


function test()
{
    static $a = [];
    if (empty($a)) {
        $a[] = rand(1, 100);
    }
    return $a;
}